package matossian.j2se6.examples.collections;

import java.util.HashSet;
import java.util.Set;
import java.util.TreeSet;

public class Sets {

	public static void main(String[] args) {
		Set<String> s = new HashSet<String>();
		String a = "a";
		String b = "b";
		String c = "c";
		s.add(a);
		s.add(b);
		s.add(c);
		System.out.println(s.contains(b));
		s.remove(b);
		System.out.println(s.contains(b));
		for(String str : s) {
			System.out.println("\t- " + str);
		}
		
		
		Set<String> s2 = new TreeSet<String>();
		s2.add(a);
		s2.add(b);
		s2.add(c);
		System.out.println(s2.contains(b));
		s2.remove(b);
		System.out.println(s2.contains(b));
		for(String str : s2) {
			System.out.println("\t- " + str);
		}
	}

}
